import React from 'react';
import {StyleSheet, View, Text, TextInput} from 'react-native';

export default class TextInputTest extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      text: '默认值'
    }
  }

  render() {
    return (
      <View>
        <Text>{this.state.text}</Text>
        <TextInput value={this.state.text} onChangeText={(text) => this.setState({text})}></TextInput>
        <TextInput value={this.state.text}></TextInput>
      </View>
    )
  }
}